package cn.itcast.hotel;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * -----------------------------------------------------------------------------------------
 * 0.ElasticSearch和RabbitMQ的学习DEMO(生产者端)
 * https://gitee.com/wjw888/es_mq_producer.git
 * -----------------------------------------------------------------------------------------
 * 1.项目启动前,需启动:
 * RabbitMQ服务、elasticSearch、kibana
 * http://localhost:15672/    rabbitMQ访问地址:admin/admin(账/密)
 * http://localhost:9200/     elasticSearch版本信息查看
 * http://localhost:5601/     kibana在Dev Tools窗口可以发送DSL语句操作ES
 * -----------------------------------------------------------------------------------------
 * 2.项目启动后,访问地址为：127.0.0.1:8081
 * -----------------------------------------------------------------------------------------
 * 3.本微服务启动后作为RabbitMQ的'生产者',再页面进行增、删、改操作时,向对应的交换机、队列中发送消息
 * -----------------------------------------------------------------------------------------
 */
@MapperScan(basePackages = "cn.itcast.hotel.mapper")
@SpringBootApplication
public class HotelAdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(HotelAdminApplication.class, args);
    }

    // 最新版
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}
